function getType(arg) {
    if(arg == null) {
        return arg + ''
    }
    // 判断是引用数据类型的情况
    if(typeof arg == 'object') {
        let flag = Object.prototype.toString.call(arg)
        let value = flag.slice(8,-1)
        return value.toLowerCase()
    }
    else {
        return typeof arg
    } 
}



console.log(getType(1),
getType('1'),
getType([]),
getType({}),
getType(function a() {}),
getType(Symbol('a'))
);
// console.log(Object.prototype.toString.call({}).slice(8,-1) == 'Object');